﻿@{
    Layout = "~/Views/Shared/_Root.cshtml";
}
@using Nop.Core.Infrastructure;
@using Nop.Services.Configuration;
@{
    //current category ID
    int currentCategoryId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("category", StringComparison.InvariantCultureIgnoreCase))
    {
        currentCategoryId = Convert.ToInt32(Url.RequestContext.RouteData.Values["categoryId"].ToString());
    }


    //current manufacturer ID
    int currentManufacturerId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("manufacturer", StringComparison.InvariantCultureIgnoreCase))
    {
        currentManufacturerId = Convert.ToInt32(Url.RequestContext.RouteData.Values["manufacturerId"].ToString());
    }


    //current product ID
    int currentProductId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("product", StringComparison.InvariantCultureIgnoreCase))
    {
        currentProductId = Convert.ToInt32(Url.RequestContext.RouteData.Values["productId"].ToString());
    }

    var categoryNavigationEnabled = EngineContext.Current.Resolve<ISettingService>().GetSettingByKey<bool>("electronicsthemesettings.defaultcategorynavigationenabled", false);
}
<div class="master-wrapper-side-2">
    @if (IsSectionDefined("left"))
    {
        @RenderSection("left")
    }
    else
    {
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "left_side_column_before" })
        <div class="clear">
        </div>
        if (categoryNavigationEnabled)
        {
	        @Html.Action("CategoryNavigation", "Catalog", new { currentCategoryId = currentCategoryId, currentProductId = currentProductId })
            <div class="clear">
            </div>
        }   
        @Html.Action("ManufacturerNavigation", "Catalog", new { currentManufacturerId = currentManufacturerId })        
        <div class="clear">
        </div>
        @Html.Action("NewsletterBox", "Newsletter")
        <div class="clear">
        </div>
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "left_side_column_after" })
    }
</div>
<div class="master-wrapper-center-2">
    <div class="master-wrapper-cph-2">
        <div class="boxtitle">
            <div>
                <div>
                </div>
            </div>
        </div>
        <div class="main-border-left">
            <div class="main-border-right">
                <div class="main-content">
                    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "main_column_before" })
                    @RenderBody()
                    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "main_column_after" })
                </div>
            </div>
        </div>
        <div class="boxbottom">
            <div>
                <div>
                </div>
            </div>
        </div>
    </div>
</div>
